go/types.Checker.error (method)

69 uses

	go/types (current package)
		assignments.go#L81: 			check.error(x, code, msg)
		builtins.go#L571: 			check.error(argList[1], SwappedMakeArgs, invalidArg+"length and capacity swapped")
		call.go#L859: 			check.error(e, InvalidDeclCycle, "illegal cycle in method declaration")
		check.go#L368: 				check.error(file.Name, BlankPkgName, "invalid package name _")
		const.go#L29: 		check.error(atPos(opPos), InvalidConstVal, "constant result is not representable")
		decl.go#L575: 				check.error(tdecl.Type, MisplacedTypeParam, "cannot use type parameter declared in alias declaration as RHS")
		decl.go#L587: 				check.error(tdecl, UnsupportedFeature, "generic type alias requires GODEBUG=gotypesalias=1 or unset")
		decl.go#L630: 		check.error(tdecl.Type, MisplacedTypeParam, "cannot use a type parameter as RHS in type declaration")
		decl.go#L677: 				check.error(f.Type, MisplacedTypeParam, "cannot use a type parameter as constraint")
		errors.go#L234: func (check *Checker) error(at positioner, code Code, msg string) {
		expr.go#L162: 			check.error(e, UndefinedOp, "cannot use ~ outside of interface or type constraint")
		expr.go#L166: 		check.error(e, UndefinedOp, "cannot use ~ outside of interface or type constraint (use ^ for bitwise complement)")
		expr.go#L835: 			check.error(&y, DivByZero, invalidOp+"division by zero")
		expr.go#L845: 				check.error(&y, DivByZero, invalidOp+"division by zero")
		expr.go#L1060: 		check.error(e, InvalidSyntaxTree, "invalid use of ...")
		expr.go#L1117: 			check.error(e, BadTypeKeyword, "use of .(type) outside type switch")
		expr.go#L1186: 		check.error(e, InvalidSyntaxTree, "no key:value expected")
		index.go#L274: 				check.error(at, InvalidSliceExpr, invalidOp+"3-index slice of string")
		index.go#L321: 		check.error(inNode(e, e.Rbrack), InvalidSyntaxTree, "2nd and 3rd index required in 3-index slice")
		index.go#L381: 		check.error(expr.indices[1], InvalidIndex, invalidOp+"more than one index")
		instantiate.go#L199: 		check.error(atPos(pos), WrongTypeArgCount, msg)
		interface.go#L178: 			check.error(name, BlankIfaceMethod, "methods must have a unique non-blank name")
		interface.go#L197: 			check.error(at, InvalidSyntaxTree, "methods cannot have type parameters")
		literals.go#L144: 		check.error(e, UntypedLit, "missing type in composite literal")
		literals.go#L165: 					check.error(e, MixedStructLit, "mixture of field:value and value elements in struct literal")
		literals.go#L183: 					check.error(kv.Key, MissingLitField, msg)
		literals.go#L201: 					check.error(kv, MixedStructLit, "mixture of field:value and value elements in struct literal")
		literals.go#L257: 				check.error(e, MissingLitKey, "missing key in map literal")
		range.go#L154: 			check.error(noNewVarPos, NoNewVar, "no new variables on left side of :=")
		resolver.go#L67: 			check.error(s, code, "missing type or init expr")
		resolver.go#L111: 		check.error(ident, InvalidInitDecl, "cannot declare init - must be func")
		resolver.go#L118: 		check.error(ident, InvalidMainDecl, "cannot declare main - must be func")
		resolver.go#L151: 			check.error(at, BadImportPath, "cannot use FakeImportC and go115UsesCgo together")
		resolver.go#L285: 						check.error(d.spec.Name, ImportCRenamed, `cannot rename import "C"`)
		resolver.go#L291: 					check.error(d.spec, InvalidInitDecl, "cannot import package as init - init must be a func")
		resolver.go#L407: 						check.error(d.decl.Recv, BadRecv, "method has no receiver")
		resolver.go#L546: 					check.error(ix.orig, InvalidSyntaxTree, "parameterized receiver contains nil parameters")
		signature.go#L169: 			check.error(recvPar.List[n-1], InvalidRecv, "method has multiple receivers")
		signature.go#L183: 			check.error(ftyp.TypeParams, InvalidMethodTypeParams, "methods cannot have type parameters")
		signature.go#L329: 			check.error(rparam.Names[n-1], InvalidRecv, "method has multiple receivers")
		signature.go#L427: 					check.error(name, InvalidSyntaxTree, "anonymous parameter")
		signature.go#L447: 		check.error(list, InvalidSyntaxTree, "list contains both named and anonymous parameters")
		stmt.go#L49: 		check.error(atPos(body.Rbrace), MissingReturn, "missing return")
		stmt.go#L143: 			check.error(s, InvalidSyntaxTree, "case/communication clause expected")
		stmt.go#L508: 				check.error(s, InvalidSyntaxTree, "missing lhs in assignment")
		stmt.go#L576: 				check.error(s, MisplacedBreak, "break not in for, switch, or select statement")
		stmt.go#L580: 				check.error(s, MisplacedContinue, "continue not in for statement")
		stmt.go#L593: 				check.error(s, MisplacedFallthrough, msg)
		stmt.go#L613: 			check.error(s.Cond, InvalidCond, "non-boolean condition in if statement")
		stmt.go#L624: 			check.error(s.Else, InvalidSyntaxTree, "invalid else branch in if statement")
		stmt.go#L658: 				check.error(c, InvalidSyntaxTree, "incorrect expression switch case")
		stmt.go#L695: 				check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
		stmt.go#L701: 				check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
		stmt.go#L716: 			check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
		stmt.go#L723: 			check.error(s, InvalidSyntaxTree, "incorrect form of type switch guard")
		stmt.go#L749: 				check.error(s, InvalidSyntaxTree, "incorrect type switch case")
		stmt.go#L819: 				check.error(clause.Comm, InvalidSelectCase, "select case must be send or receive (possibly with assignment)")
		stmt.go#L841: 				check.error(s.Cond, InvalidCond, "non-boolean condition in for statement")
		stmt.go#L861: 		check.error(s, InvalidSyntaxTree, "invalid statement")
		struct.go#L156: 						check.error(embeddedPos, InvalidPtrEmbed, "embedded field type cannot be unsafe.Pointer")
		struct.go#L159: 					check.error(embeddedPos, InvalidPtrEmbed, "embedded field type cannot be a pointer")
		struct.go#L165: 						check.error(embeddedPos, MisplacedTypeParam, "embedded field type cannot be a (pointer to a) type parameter")
		struct.go#L169: 						check.error(embeddedPos, InvalidPtrEmbed, "embedded field type cannot be a pointer to an interface")
		typexpr.go#L28: 			check.error(e, InvalidBlank, "cannot use _ as value or type")
		typexpr.go#L100: 				check.error(e, InvalidIota, "cannot use iota outside constant declaration")
		typexpr.go#L307: 			check.error(e.Len, BadDotDotDotSyntax, "invalid use of [...] array (outside a composite literal)")
		typexpr.go#L320: 		check.error(e, InvalidSyntaxTree, "invalid use of ...")
		union.go#L121: 					check.error(tlist[i], InvalidUnion, "cannot use comparable in union")
		union.go#L156: 			check.error(x, MisplacedTypeParam, "term cannot be a type parameter")